import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-news',
  templateUrl: './news.component.html',
  styleUrls: ['./news.component.scss']
})
export class NewsComponent implements OnInit {

  public title = "我是一个新闻组件"
  msg = 'msg新闻组件'
  username: string = 'zhangsan'

  public student: any = 123
  public message: any
  public content: any = '<h2>解析HTML</h2>'

  // 定义数组
  public arr: Array<number> = [1, 2, 3, 4]
  public userlist: any[] = [{
    username: 'zhangsan',
    age: 20
  }, {
    username: 'lisi',
    age: 22
  },
  {
    username: 'wangwu',
    age: 23
  }
  ]
  constructor() {
    // 获取属性的值
    this.message = '213'
    // 改变属性的值
    this.msg = '我是改变后的msg的值'
    console.log(this.message);

  }

  ngOnInit(): void {
  }

}
